﻿<UserControl x:Class="ModernAudioTagger.Content.ContentAudioTagVertical"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:mui="http://firstfloorsoftware.com/ModernUI"
             xmlns:provider="clr-namespace:ModernAudioTagger.Provider"
             xmlns:converter="clr-namespace:ModernAudioTagger.Converter"
             xmlns:mscorelib="clr-namespace:System;assembly=mscorlib"  
             xmlns:blogic="clr-namespace:ModernAudioTagger.BusinessLogic"
             mc:Ignorable="d"              
             d:DesignHeight="500" d:DesignWidth="350">

    <UserControl.DataContext>
        <Binding Source="{x:Static provider:ViewModelLocator.Instance}" Path="TrackTagVM" />
    </UserControl.DataContext>

    <UserControl.Resources>
        <mscorelib:Double x:Key="text_width" >250</mscorelib:Double>
        <converter:ArraySplitConverter x:Key="arraySplitConverter" />
    </UserControl.Resources>


    <ScrollViewer>
        <StackPanel HorizontalAlignment="Stretch">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <!--<ColumnDefinition Width="Auto"></ColumnDefinition>-->
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition></RowDefinition>
                    <RowDefinition></RowDefinition>
                    <RowDefinition></RowDefinition>
                    <RowDefinition></RowDefinition>
                    <RowDefinition></RowDefinition>
                    <RowDefinition></RowDefinition>
                    <RowDefinition></RowDefinition>
                    <RowDefinition></RowDefinition>
                    <RowDefinition></RowDefinition>
                    <RowDefinition></RowDefinition>
                </Grid.RowDefinitions>

                <TextBlock HorizontalAlignment="Center" Text="Track" Style="{StaticResource Title}" Grid.ColumnSpan="3" />

                <!-- Title -->
                <TextBlock 
                    HorizontalAlignment="Left"
                    Width="Auto"
                    Grid.Row="1"
                    Margin="{StaticResource DefaultTopLeftMargin}" 
                    Text="Title" Style="{StaticResource Heading2}" />
                <TextBox 
                    IsReadOnly="True"
                    Margin="{StaticResource DefaultTopLeftMargin}" 
                    HorizontalAlignment="Left"
                    Width="{StaticResource text_width}"                  
                    Text="{Binding SelectedModelTag.Title, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" 
                    Grid.Row="1" Grid.Column="1" 
                />
                <!--<CheckBox
                    IsChecked="{Binding IncludeTitle, Mode=TwoWay}"
                    HorizontalAlignment="Left"
                    Margin="{StaticResource DefaultTopLeftMargin}"
                    Grid.Row="1" Grid.Column="2" 
                />-->

                <!-- Position -->
                <TextBlock 
                    Width="Auto"
                    HorizontalAlignment="Left"
                    Grid.Row="2"                    
                    Margin="{StaticResource DefaultTopLeftMargin}" 
                    Text="Position" Style="{StaticResource Heading2}" />
                <TextBox 
                    IsReadOnly="True"
                    HorizontalAlignment="Left"
                    Margin="{StaticResource DefaultTopLeftMargin}" 
                    Width="30"                  
                    Text="{Binding SelectedModelTag.Position, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" 
                    Grid.Row="2" Grid.Column="1" 
                />
                <!--<CheckBox
                    IsChecked="{Binding IncludePosition, Mode=TwoWay}"
                    HorizontalAlignment="Left"
                    Margin="{StaticResource DefaultTopLeftMargin}"
                    Grid.Row="2" Grid.Column="2" 
                />-->



                <!-- Artists -->
                <TextBlock                     
                    Grid.Row="3"
                    Width="Auto"
                    HorizontalAlignment="Left"
                    Margin="{StaticResource DefaultTopLeftMargin}" 
                    Text="Artists" Style="{StaticResource Heading2}" />
                <!--<ComboBox                     
                    SelectedItem="{Binding SelectedTrackArtist, Mode=TwoWay}"
                    ItemsSource="{Binding SelectedTagTrack.Artists}" 
                    DisplayMemberPath="Name"
                    Text="{Binding ManualTrackArtist, Mode=TwoWay}" 
                    IsTextSearchEnabled="True"
                    IsEditable="True"                     
                    Grid.Column="1" Grid.Row="3"               
                    Margin="{StaticResource DefaultTopLeftMargin}" 
                    Width="{StaticResource text_width}"             
                    HorizontalAlignment="Left"
                    >
                </ComboBox>
                -->
                <TextBox
                    IsReadOnly="True"
                    Text="{Binding SelectedModelTag.TrackArtists, Mode=TwoWay, Converter={StaticResource arraySplitConverter}}" 
                    Grid.Column="1" Grid.Row="3"               
                    Margin="{StaticResource DefaultTopLeftMargin}" 
                    Width="{StaticResource text_width}"             
                    HorizontalAlignment="Left"
                    >
                </TextBox>
                
                <!--<CheckBox
                    IsChecked="{Binding IncludeTrackArtist, Mode=TwoWay}"
                    HorizontalAlignment="Left"
                    Margin="{StaticResource DefaultTopLeftMargin}"
                    Grid.Row="3" Grid.Column="2" 
                />-->

                <!-- Genres -->
                <!--<TextBlock                     
                    Grid.Row="4"
                    Width="Auto"
                    HorizontalAlignment="Left"
                    Margin="{StaticResource DefaultTopLeftMargin}" 
                    Text="Genres" Style="{StaticResource Heading2}" />
            <TextBox 
                    HorizontalAlignment="Left"
                    Margin="{StaticResource DefaultTopLeftMargin}" 
                    Width="{StaticResource text_width}"                  
                    Text="{Binding Genres, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" 
                    Grid.Row="4" Grid.Column="1" 
                />-->
                <!--<CheckBox
                    IsChecked="{Binding IncludeGenres, Mode=TwoWay}"
                    HorizontalAlignment="Left"
                    Margin="{StaticResource DefaultTopLeftMargin}"
                    Grid.Row="4" Grid.Column="2" 
                />-->

                <!-- MusicBrainzID -->
                <TextBlock 
                    Width="Auto"
                    HorizontalAlignment="Left"
                    Margin="{StaticResource DefaultTopLeftMargin}" 
                    Text="MbId" Style="{StaticResource Heading2}" 
                    Grid.Row="4"
                />
                <TextBox 
                    IsReadOnly="True"
                    HorizontalAlignment="Left"
                    Margin="{StaticResource DefaultTopLeftMargin}" 
                    Width="{StaticResource text_width}"    
                    Text="{Binding SelectedModelTag.TrackMbid, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                    FontSize="{StaticResource SmallFontSize}"
                    Grid.Row="4" Grid.Column="1" />

                <TextBlock Grid.Row="5" Grid.ColumnSpan="3" HorizontalAlignment="Center" Text="Release" Style="{StaticResource Title}" Margin="{StaticResource DefaultTopMargin}" />

                <!-- Album -->
                <TextBlock 
                    Width="Auto"
                    HorizontalAlignment="Left"
                    Margin="{StaticResource DefaultTopLeftMargin}" 
                    Text="Album" Style="{StaticResource Heading2}" 
                    Grid.Row="6"
                />
                
                <!--<ComboBox                     
                    SelectedItem="{Binding SelectedRelease, Mode=TwoWay}"
                    ItemsSource="{Binding SelectedTagTrack.Releases}" 
                    DisplayMemberPath="Title"
                    Text="{Binding ManualRelease, Mode=TwoWay}" 
                    IsTextSearchEnabled="True"
                    IsEditable="True"                     
                    Grid.Column="1" Grid.Row="6"               
                    Margin="{StaticResource DefaultTopLeftMargin}" 
                    Width="{StaticResource text_width}"        
                    HorizontalAlignment="Left"
                    >
                </ComboBox>-->
                <TextBox
                    IsReadOnly="True"
                    Grid.Column="1" Grid.Row="6"               
                    Text="{Binding SelectedModelTag.Album, Mode=TwoWay}"                     
                    Margin="{StaticResource DefaultTopLeftMargin}" 
                    Width="{StaticResource text_width}"        
                    HorizontalAlignment="Left">
                </TextBox>
                <!--<CheckBox 
                    IsChecked="{Binding IncludeRelease, Mode=TwoWay}"
                    Grid.Column="2" Grid.Row="6"
                    Margin="{StaticResource DefaultTopLeftMargin}"
                    HorizontalAlignment="Left"
                    />-->

                <!-- Artists -->
                <TextBlock 
                    Width="Auto"
                    HorizontalAlignment="Left"
                    Margin="{StaticResource DefaultTopLeftMargin}" 
                    Text="Artists" Style="{StaticResource Heading2}" 
                    Grid.Row="7"
                />
                <!--
                <ComboBox                     
                    SelectedItem="{Binding SelectedReleaseArtist, Mode=TwoWay}"
                    ItemsSource="{Binding SelectedRelease.Artists}"                     
                    DisplayMemberPath="Name"
                    Text="{Binding ManualReleaseArtist, Mode=TwoWay}" 
                    IsTextSearchEnabled="True"
                    IsEditable="True"                     
                    Grid.Column="1" Grid.Row="7"               
                    Margin="{StaticResource DefaultTopLeftMargin}" 
                    Width="{StaticResource text_width}"        
                    HorizontalAlignment="Left"
                    >
                </ComboBox>
                -->
                <TextBox
                    IsReadOnly="True"
                    Text="{Binding SelectedModelTag.AlbumArtists, Mode=TwoWay, Converter={StaticResource arraySplitConverter}}" 
                    Grid.Column="1" Grid.Row="7"               
                    Margin="{StaticResource DefaultTopLeftMargin}" 
                    Width="{StaticResource text_width}"        
                    HorizontalAlignment="Left"
                    >                    
                </TextBox>
                <!--<CheckBox 
                    IsChecked="{Binding IncludeReleaseArtist, Mode=TwoWay}"
                    Grid.Column="2" Grid.Row="7"
                    Margin="{StaticResource DefaultTopLeftMargin}"
                    HorizontalAlignment="Left"
                    />-->

                <!-- Year -->
                <TextBlock 
                    Width="Auto"
                    HorizontalAlignment="Left"
                    Margin="{StaticResource DefaultTopLeftMargin}" 
                    Text="Year" Style="{StaticResource Heading2}" 
                    Grid.Row="8"
                />
                <TextBox 
                    IsReadOnly="True"
                    HorizontalAlignment="Left"
                    Margin="{StaticResource DefaultTopLeftMargin}" 
                    Width="{StaticResource text_width}"    
                    Text="{Binding SelectedModelTag.Year, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                    Grid.Row="8" Grid.Column="1" />
                <!--<CheckBox 
                    IsChecked="{Binding IncludeYear, Mode=TwoWay}"
                    Grid.Column="2" Grid.Row="8"
                    Margin="{StaticResource DefaultTopLeftMargin}"
                    HorizontalAlignment="Left"
                    />-->
                <TextBlock 
                    Width="Auto"
                    HorizontalAlignment="Left"
                    Margin="{StaticResource DefaultTopLeftMargin}" 
                    Text="MbId" Style="{StaticResource Heading2}" 
                    Grid.Row="9"
                />
                <TextBox 
                    IsReadOnly="True"
                    HorizontalAlignment="Left"
                    Margin="{StaticResource DefaultTopLeftMargin}" 
                    Width="{StaticResource text_width}"    
                    Text="{Binding SelectedModelTag.ReleaseMbid, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                    FontSize="{StaticResource SmallFontSize}"
                    Grid.Row="9" Grid.Column="1" />
            </Grid>

            <!--<Grid Margin="{StaticResource DefaultTopLeftMargin}">
            <Grid.ColumnDefinitions>
                <ColumnDefinition></ColumnDefinition>
                <ColumnDefinition></ColumnDefinition>
                <ColumnDefinition></ColumnDefinition>
                <ColumnDefinition></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition></RowDefinition>
                <RowDefinition></RowDefinition>                
            </Grid.RowDefinitions>-->

            <Border 
                HorizontalAlignment="Center"
                Margin="{StaticResource DefaultTopMargin}"
                BorderThickness="1"
                MinWidth="128"
                MinHeight="128"
                BorderBrush="{DynamicResource SeparatorBackground}"
            >
                <Image       
                    HorizontalAlignment="Center"                 
                    MaxWidth="128" 
                    MaxHeight="128"             
                    Stretch="Uniform"                
                    Source="{Binding ImagePath, TargetNullValue={x:Null}, FallbackValue={x:Null}}"                    
                />
            </Border>
            <!--
            <CheckBox IsChecked="{Binding IncludePicture}" Grid.Row="1" Margin="{StaticResource DefaultTopLeftMargin}" />
            <mui:ModernButton Grid.Row="1" Grid.Column="1" Margin="{StaticResource DefaultTopLeftMargin}" />
            <mui:ModernButton Grid.Row="1" Grid.Column="2" Margin="{StaticResource DefaultTopLeftMargin}" />
            <mui:ModernButton Grid.Row="1" Grid.Column="3" Margin="{StaticResource DefaultTopLeftMargin}" />
            -->
            <!--</Grid>-->


        </StackPanel>
    </ScrollViewer>

</UserControl>
